//
//  AreaCollectionViewCell.m
//  demo
//
//  Created by dllo on 15/7/11.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "AreaCollectionViewCell.h"

@implementation AreaCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame
{
    if ([super initWithFrame:frame]) {
        self.label = [[UILabel alloc] init];
        self.label.textAlignment = NSTextAlignmentCenter;
        self.label.font = [UIFont systemFontOfSize:13];
        self.label.textColor = [UIColor colorWithRed:44 / 255.0 green:110 / 255.0 blue:125 / 255.0 alpha:1];
        self.label.layer.cornerRadius = 1.0;
        self.label.layer.masksToBounds = YES;
        self.label.layer.borderColor = [UIColor colorWithRed:44 / 255.0 green:110 / 255.0 blue:125 / 255.0 alpha:1].CGColor;
        self.label.layer.borderWidth = 0.8;
        [self.contentView addSubview:self.label];
        [_label release];
    }
    return self;
}
- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    self.label.frame = CGRectMake(0, 0, layoutAttributes.size.width, layoutAttributes.size.height);
}
-(void)setArea:(Area *)area
{
    if (_area != area) {
        [_area release];
        _area = [area retain];
    }
    self.label.text = area.name_zh_cn;
}
@end
